# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-grpc
_extname=grpc
pkgver=1.60.0
pkgrel=0
pkgdesc="PHP 8.2 extension provide a concrete implementation of the gRPC protocol, layered over HTTP/2."
url="https://pecl.php.net/package/grpc"
arch="all !s390x !ppc64le !riscv64" # build failures
license="Apache-2.0"
_phpv=82
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev openssl-dev linux-headers"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	# Test suite is not a part of pecl release.
	$_php -d extension=modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/50_$_extname.ini
}

sha512sums="
d0a687865f6429c3aad9812c3fe84bd37971f0e37d57112bbb9ace52396f9adb5e9a8a662aa3419997342864cf5ba43ebda69de5cf19ee0530d2f8d952078d12  php-pecl-grpc-1.60.0.tgz
"
